#ifndef _SOUND_MANAGER_H_
#define _SOUND_MANAGER_H_

#ifdef _WIN32
#pragma once
#endif

#include <map>
#include <string>
#include <sstream>
#include <Windows.h>

#include "fmod.hpp"

#include "sound.h"

using FMOD::System;
using FMOD::Sound;

using std::pair;
using std::map;
using std::string;
using std::stringstream;

class CSoundManager
{
public:
    static CSoundManager *getInstance();

    CSound *addStream(const string &szPath);
    CSound *addSound(const string &szPath);

    CSound *getSound(const string &szPath) const;
    bool hasSound(const string &szPath) const;
    bool removeSound(const string &szPath);

    float increaseMasterVolume();
    void setMasterVolume(float fMasterVolume);
    float getMasterVolume();

    bool isMuted() const;
    void setMute(bool bMute);

private:
    ~CSoundManager();
    CSoundManager();
    CSoundManager(const CSoundManager &rhs) {}
    CSoundManager& operator=(const CSoundManager &rhs) {}

    map<string, CSound*> m_arrSounds;

    System *m_pSoundManager;

    float m_fMasterVolume;
    bool m_bMute;
};

#endif